#!/bin/bash

set -e

  expect <<EOF
set timeout -1
spawn ssh -o StrictHostKeyChecking=no $1 "ls -l ~ >/dev/null"
expect {
"*(yes/no)*" {send  "yes\r";exp_continue}
"*assword:*" {exit 77}
eof        {exit 0}}
EOF
